<template>
  <el-container>
    <el-header style="padding: 0">
      <el-row>
        <el-col :span="3">
          <div class="grid-content"></div>
        </el-col>
        <el-col :span="3">
          <el-image style="height: 60px" :src="logo"></el-image>
        </el-col>
        <el-col :span="6">
          <el-menu
            default-active="/blog/newest"
            class="el-menu-demo"
            mode="horizontal"
            background-color="#323f48"
            text-color="#fff"
            active-text-color="#ffd04b"
            router
          >
            <el-menu-item index="/blog/newest">最新</el-menu-item>
            <el-menu-item index="/blog/classify">分类</el-menu-item>
          </el-menu>
        </el-col>
        <el-col :span="3">
          <el-input placeholder="搜索" suffix-icon="el-icon-search"></el-input>
        </el-col>
        <el-col :span="3">
          <div class="grid-content"></div>
        </el-col>
        <el-col :span="3">
          <el-button
            type="info"
            icon="icon-feather"
            round
            v-on:click="editNewBlog"
            >写文章</el-button
          >
        </el-col>
        <el-col :span="3">
          <div class="grid-content"></div>
        </el-col>
      </el-row>
    </el-header>
    <el-main>
      <router-view />
    </el-main>
  </el-container>
</template>

<script>
export default {
  data() {
    return {
      logo: require("../assets/blogYouLife.png"),
    };
  },
  methods: {
    editNewBlog: function () {
      var routeData = this.$router.resolve({ path: "/edit" });
      window.open(routeData.href, "_blank");
    },
  },
};
</script>

<style>
body {
  margin: 0;
}
.el-header {
  position: relative;
  background-color: #323f48;
  color: #333;
  text-align: center;
}
.el-header .el-row {
  height: 60px;
}
.el-header .el-input {
  margin-top: 10px;
}
.el-header .el-button {
  margin-top: 8px;
}
.el-header .el-input__inner {
  border-radius: 40px;
}
.el-main {
  background-color: #e9eef3;
  color: #333;
  text-align: center;
  position: absolute;
  left: 0;
  right: 0;
  top: 60px;
  bottom: 0;
  overflow-y: scroll;
  padding: 20px 0 20px 0 !important;
}
.grid-content {
  border-radius: 4px;
  min-height: 60px;
}
.bg-purple-dark {
  background: #99a9bf;
}
</style>